/*
 * Copyright (c) 2021, mrwang. All rights reserved.
 */

package com.wuyan.eurekaserver.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

/**
 * @author dong
 * @version V1.0
 * @file com.wuyan.eurekaserver.config.WebSecurityConfig
 * @description
 * @date 2021-02-22
 * @update [序号][日期YYYY-MM-DD] [更改人姓名][变更描述]
 */
@EnableWebSecurity
@Configuration
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {

	@Override
	protected void configure(HttpSecurity http) throws Exception {
		http.csrf().disable(); //关闭csrf
		http.authorizeRequests().anyRequest().authenticated().and().httpBasic(); //开启认证
	}
}